import Vue from 'vue'
import App from './App'
import cuCustom from './colorui/components/cu-custom.vue'
import tool from './utils/tool.js'
var log = require('./utils/log.js');
var api = require('./api/index.js');
Vue.component('cu-custom', cuCustom)

import uView from "uview-ui";
Vue.use(uView);

Vue.prototype.$log = log
Vue.prototype.$api = api
Vue.prototype.$tool = tool
Vue.config.productionTip = false

Vue.prototype.isLogin = () => {
	var userInfo = uni.getStorageSync('userInfo');
	if (userInfo) return true
	uni.showModal({
		title: '提示',
		content: '还未登录，请先登录',
		showCancel: true,
		cancelText: '否',
		confirmText: '去登录',
		success: res => {
			if (res.confirm) {
				uni.navigateTo({
					url: '/user/login/login'
				})
			}
		}
	});
	return false
}
App.mpType = 'app'

const app = new Vue({
	...App
})

app.$mount()
